"use strict";
// 解析地址栏参数
function UrlObj(url) {
    const urlArr = url.split('?')[1].split('&');
    let obj = {};
    urlArr.forEach(item => {
        const keys = item.split("=")[0];
        obj = Object.assign(Object.assign({}, obj), { [keys]: item.split("=")[1] });
    });
    return obj;
}
const urlValue = UrlObj(location.href);
Ajax(`/api/getDetail?id=${urlValue.id}`, (data) => {
    render(data.data1);
});
function render(data) {
    const detailBox = document.querySelector('.detailBox');
    detailBox.innerHTML = `
        <div>
            <h1>${data.title}</h1>
            <img  src="${data.img}" alt/>
        </div>
    `;
}
